package com.ruitu.mall_98_2.mvp.model;

import com.ruitu.mall_98_2.dao.APIRetrofit;
import com.ruitu.mall_98_2.mvp.contract.BandingThirdAccountContract;
import com.ruitu.router_module.bean.api.BaseResult;

import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class BandingThirdAccountModel implements BandingThirdAccountContract.Model {
    @Override
    public Observable<BaseResult> bindingQqOrWx(String openId, String type, String accountId,String otherName) {
        return APIRetrofit.getDefault().bindingQqOrWx(openId, type, accountId,otherName)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }

    @Override
    public Observable<BaseResult> unbindQqOrWx(String type, String accountId) {
        return APIRetrofit.getDefault().unbindQqOrWx(type, accountId)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io());
    }

//    @Override
//    public Observable<BaseResult> bindAlipay(String accountId, String alipayId, String alipayName) {
//        return APIRetrofit.getDefault().bindAlipay(accountId, alipayId, alipayName)
//                .observeOn(AndroidSchedulers.mainThread())
//                .subscribeOn(Schedulers.io());
//    }
}
